Script Daemon allows you to telnet to your Mac and enter AppleScript commands. Only the owner can log in (using the Owner name&password).
It currently assumes and relies on AppleScript English. Sorry. If you don’t like this, let me know.
Note: This release is a bit rough. I don’t know how this will be used, so I’m basically releasing it to let you tell me what you want.
Using Script Daemon
Put the Users and Groups in the Scripting Additions folder, and put an alias to Script Daemon into the Startup Items folder and launch it. Now telnet to your mac, log in using the owner name and owner password, and type AppleScript commands. Script Daemon itself accepts certain (non-AppleScript) commands, these commands start with a slash (/). The following commands are implemented:
/HELP - list the commands.
/EXEC - enter a multi-line AppleScript script. Terminate the script by typing a period (.) on a line by itself. Currently there is no way of aborting a script.
/QUIT - close the connection and quit.
Lines not starting with a slash are passed through to AppleScript. Note that a line "quit" means the AppleScript command "quit" which by default quits the current application, namely Script Daemon - since this is usually not what you want to do, I disallow it, type "<space>quit" if you really mean it.
Note that the context information is preserved permanently. That is, you can type AppleScript commands like:
set test to "fred"
And then quit Script Daemon and relaunch it, and then type:
test
And it will display "fred".
Limitations
Script Daemon requires MacTCP 1.1, System 7, and AppleScript.
Script Daemon will work with AppleShare 3, but its a bit of a hack. The problem is that to do any operation on the U&G file under ASFS you need to pass in the admin key. The osax lets you do this by supplying an optional parameter. Drop the osax on to the Script Editor to see the syntax. Script Daemon authenticates the user by executing string 5 from the STR# 128 resource. This looks like this...
authenticate user name "^1" password "^2"
If you bash this (using ResEdit) to this...
authenticate user admin «your_admin_key» name "^1" password "^2"
it should work under ASFS. [Replace «your_admin_key» with a string
containing the admin key for your ASFS.]
Security Warning: Your copy of Script Daemon now has a plain text copy of your admin password, so keep it very secure.
Small Print
This program is Free. You can use it anywhere you want, you can do anything you like with it.
Warranty
While I have made every attempt at making this program work correctly, I cannot guarantee it will work. If it doesn’t work, I’ll refund your money :-)
The Users and Groups addition is from Quinn at the University of Western Australia’s Computer Science department. It is available seperately, and is included with this package for your convenience.
Fine Print
Peter Lewis hereby disclaims all warranties relating to this software, whether express or implied, including without limitation any implied warranties of merchantability or fitness for a particular purpose. Peter Lewis will not be liable for any special, incidental, consequential, indirect or similar damages due to loss of data or any other reason, even if Peter Lewis or an agent of his has been advised of the possibility of such damages. In no event shall Peter Lewis be liable for any damages, regardless of the form of the claim. The person using the software bears all risk as to the quality and performance of the software.
How It Works
Script Daemon listens to port 23 (the telnet port), accepts logins, validates them using the Users and Groups AppleScript extension (thanks to Comp Sci at UWA!), and then compiles and executes scripts. The external interface uses the ISO-8859-1 character set.
Version History
Still to do -
Some way of allowing more than just the owner to connect, perhaps a File Sharing group?
Some way of allowing people to connect but not run arbitrary AppleScript commands, perhaps feed their commands to some handler you define?
Some way to abort a /exec script
.login script?
1.0.1
~Scan the <relevant> folder and find the U&G file and pass its name to the authenticate call.
1.0.0
Acknowledgements
A huge thank you goes to Quinn and UWA’s Computer Science department for making the Users & Groups AppleScript extension available and allowing me to bundle it with Script Daemon.
And another thank you goes to Onno Benschop for the icons.
And another to Quinn for lots of ideas, and to Stuart Cheshire for lots of other ideas.